home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1712 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.6 KB  |  82 lines

  1. Path: news.rwth-aachen.de!news
  2. From: ILT-Benutzer <user@ilt.fhg.de>
  3. Newsgroups: comp.lang.c++
  4. Subject: assembly lang. and Borland C++
  5. Date: 12 Jan 1996 14:08:22 GMT
  6. Organization: RWTH -Aachen / Rechnerbetrieb Informatik
  7. Message-ID: <4d5q0m$926@news.rwth-aachen.de>
  8. NNTP-Posting-Host: 192.102.148.64
  9.  
  10. I think, I have an easy question:
  11.  
  12. I wrote a projectfile with a C++module and an assembler-module in it.
  13. The C++module shall call a function written in assembly language.
  14. The solution for that problem I already have:
  15.  
  16. C++ Modul:
  17. --------------------------------------
  18. ..
  19. extern "C" void far Assemblerprozedur(void);
  20. ..
  21. --------------------------------------
  22.  
  23. Assembly language module:
  24. --------------------------------------
  25. ..
  26. PUBLIC _Assemblerprozedur;
  27. ..
  28. _Assemblerprozedur PROC FAR
  29.  
  30.        mov ax,0
  31.        push bx
  32.        ...
  33.        ...
  34.        ret
  35. _Assemblerprozedur ENDP
  36. --------------------------------------
  37.  
  38. But I need the opposite of this. The assembly language module shall
  39. call a C++routine.
  40.  
  41. I tried the following:
  42.  
  43. C++ Modul:
  44. --------------------------------------
  45. ..
  46. void CProzedur()
  47. {
  48.  ...
  49. }
  50. ..
  51. --------------------------------------
  52.  
  53. and in assembymodul:
  54. --------------------------------------
  55. ..
  56. extrn _CProzedur:far
  57. ..
  58. ..
  59. call _CProzedur  ; call the CRoutine 
  60. --------------------------------------
  61.  
  62. If I compile it as C (C-module has extension .C) code no error appears.
  63. But if I switch the key Options|compiler|C++options to
  64. CPP always the Linker says something like:
  65. Can┤t find _CProzedur ...
  66.  
  67. So, I have to tell the assembler that it has to generate C++ Code.
  68. But how ???
  69.  
  70. I would be very happy about a quick andwer !
  71.  
  72. Nice to hear of you !
  73.  
  74. Michael Bode
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.